<!DOCTYPE html>
<html lang="en">
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at
      http://www.apache.org/licenses/LICENSE-2.0
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<head>
    <meta charset="utf-8" />
    <title>PutElasticsearchJson</title>
    <link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css" />
</head>
<body>
    <p>This processor is designed to take any valid JSON and index it into Elasticsearch 5.x or newer. Unlike the record-aware
    alternative, it only does index operations, not updates, upserts or deletes.</p>
    <p>The ID for each document can be set in one of three ways:</p>
    <ul>
        <li>FlowFile attribute - only possible if the flowfile contains only a single document. Arrays of documents
        will cause an error to be raised.</li>
        <li>JsonPath operation - searches within the document for a particular field.</li>
        <li>Default - Elasticsearch will generate one. This will be used when neither the attribute nor JsonPath configuration
        fields are used.</li>
    </ul>
    <p>Example document:</p>
    <pre>
        {
            "index": "messages",
            "type": "message",
            "message": "Hello, world",
            "from": "john.smith"
        }
    </pre>
    <p>The following JsonPath operations will extract the index and type:</p>
    <ul>
        <li>$.index</li>
        <li>$.type</li>
    </ul>
</body>
</html>